-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
api: Javadoc changes for io.grpc.LoadBalancer method signatures #11623
base: master
Are you sure you want to change the base?
Conversation
…h Duration" This reverts commit ab97045.
Below points have been addressed: javadoc for public void handleResolvedAddresses(ResolvedAddresses resolvedAddresses)
javadoc for public Status acceptResolvedAddresses(ResolvedAddresses resolvedAddresses)
|
@@ -179,12 +179,12 @@ public void handleResolvedAddresses(ResolvedAddresses resolvedAddresses) { | |||
* EquivalentAddressGroup} addresses should be considered equivalent but may be flattened into a | |||
* single list if needed. | |||
* | |||
* <p>Implementations can choose to reject the given addresses by returning {@code false}. | |||
* <p>Implementations can choose to reject the given addresses by returning {@code UNAVAILABLE}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace with {@code Status.UNAVAILABLE} . Also below.
…d and related changes
* | ||
* @param resolvedAddresses the resolved server addresses, attributes, and config. | ||
* @since 1.21.0 | ||
*/ | ||
@Deprecated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a javadoc on Deprecated and what to use instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Included in Javadoc
@@ -193,7 +193,7 @@ private List<ChildLbState> updateChildrenWithResolvedAddresses( | |||
newChildLbStates.add(childLbState); | |||
if (entry.getValue() != null) { | |||
childLbState.setResolvedAddresses(entry.getValue()); // update child | |||
childLbState.lb.handleResolvedAddresses(entry.getValue()); // update child LB | |||
childLbState.lb.acceptResolvedAddresses(entry.getValue()); // update child LB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class needs to fix its handling of the Status
. I think we should leave it as-is and create a tracking bug for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving it as-is(handleResolvedAddresses) is resulting in build failure because of the deprecated warning, so i'm retaining this acceptResolvedAddresses for now to proceed further. Please confirm if this is ok and handling the Status
can be done as part of a new defect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, we can definitely suppress warning here and create a tracking bug. Add a comment with TODO mentioning the tracking bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handled
util/src/main/java/io/grpc/util/OutlierDetectionLoadBalancer.java
Outdated
Show resolved
Hide resolved
@@ -125,17 +125,17 @@ public void switchTo_handleResolvedAddressesAndNameResolutionErrorForwardedToLat | |||
helper0.updateBalancingState(READY, picker); | |||
|
|||
ResolvedAddresses addresses = newFakeAddresses(); | |||
gracefulSwitchLb.handleResolvedAddresses(addresses); | |||
verify(lb0).handleResolvedAddresses(addresses); | |||
gracefulSwitchLb.acceptResolvedAddresses(addresses); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't change any of these. These shouldn't have caused warnings because they were already marked @Deprecated
. They are testing the old code flow and need to remain until it is deleted. When the old flow is deleted, the entire set of "// OLD TESTS" will be outright deleted, as we already have tests below that test acceptResolvedAddresses (and test it more fully, as it checks the return value).
@@ -30,8 +30,8 @@ public abstract class ForwardingLoadBalancer extends LoadBalancer { | |||
protected abstract LoadBalancer delegate(); | |||
|
|||
@Override | |||
public void handleResolvedAddresses(ResolvedAddresses resolvedAddresses) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need some more thought. This change would prevent extending classes from seeing the addresses, if they are only overriding handleResolvedAddresses().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we mark this existing method as deprecated and introduce an override for acceptResolvedAddresses, please confirm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would still break an implementation only implementing handleResolvedAddresses()
# Conflicts: # util/src/main/java/io/grpc/util/MultiChildLoadBalancer.java
Javadoc changes for io.grpc.LoadBalancer
Fixes #11194